<%@ page contentType="text/html; charset=utf-8"%>
<%@ include file="/global/jsp-header.jsp"%>
<c:set var="groupDeleteVisable" value="${d:accessUri('/group/group-delete.do',pageContext.request) }"></c:set>
<c:set var="groupEditVisable" value="${d:accessUri('/group/group-edit.do',pageContext.request) }"></c:set>
<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html">
		<title>部门列表</title>
		<%@ include file="/global/tablesort-header.jsp"%>
		<script>
		var rs = "${pager.list.size()}";
		rs = ((!rs)? 0 : parseInt(rs))+1;
		var h = rs * 27 + 50;
		$(window.parent.document).find("#queryResult").removeClass("hide");
		$(window.parent.document).find("#queryResultIframe").height(h);
	</script>
	</head>
	<body>
		<c:if test="${pager.list.size() > 0}">
			<div class="pagertoleft clearBoth">
				<%@ include file="/global/pager-default.jsp"%>
			</div>
			<table id="myTable" cellspacing="1" class="tablesorter">
				<thead>
					<tr>
						<th>
							组别编号
						</th>
						<th>
							组别名称
						</th>
						<th>
							组别可用
						</th>
						<th>
							操作
						</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${pager.list }" var="item">
						<tr groupId=${item.groupId }>
							<td>
								${item.groupId }
							</td>
							<td>
								${item.groupName }
							</td>
							<td>
								<c:if test="${item.disabled eq 1 }">可用</c:if>
								<c:if test="${item.disabled eq 0 }">不可用</c:if>
							</td>
							<td>
							<c:if test="${groupEditVisable}">
								<a href="#" onclick="globalEdit(${item.groupId})">编辑</a>
							</c:if>
							<c:if test="${groupDeleteVisable}">
								<a href="#" onclick="globalDelete(${item.groupId })">删除</a>
							</c:if>
							</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</c:if>
		<c:if test="${pager.list.size() <= 0}">
			<div class="emptyResult">
				抱歉，没有找到相关组别。
			</div>
		</c:if>
	</body>
</html>
